<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
<link rel="stylesheet" href="__PUBLIC__/assets_news/css/zpui.css"/>
<link rel="stylesheet" href="__PUBLIC__/assets_news/css/all_001.css"/>
<script src="__PUBLIC__/assets_news/js/page.js"></script>

    <title> 资讯列表 </title>
</head>
<body>
<div class="page">
    <div class="page-hd">
        <div class="header bor-1px-b">
    <div class="header-left">
        <a href="javascript:history.go(-1)" class="left-arrow"></a>
    </div>
    <div class="header-title">资讯列表</div>
    <div class="header-right">
        <a href="#"></a>
    </div>
</div>
    </div>

    <div class="page-bd">
        <!-- 页面内容-->
        <div class="tuwen tumko" id="tab2">
        </div>

        <div class="weui-loadmore">
            <i class="weui-loading"></i>
            <span class="weui-loadmore__tips">正在加载</span>
        </div>
    </div>
</div>
<script src="__PUBLIC__/assets_news/js/lib/jquery-2.1.4.js"></script>
<script src="__PUBLIC__/assets_news/js/jquery-weui.min.js"></script>
<script src="__PUBLIC__/assets_news/js/lib/fastclick.js"></script>
<script>
  $(function() {
    FastClick.attach(document.body);
  });
</script>
<script>
    var ajax_status = false;
    var p = 1;
    init();
      //验证表单
    function loadlist(){
        $.ajax({
            url : "/index.php/Acc/Index/news/p/"+p,
            type:'post',
            dataType:'json',
            data:{'p':p},
            success:function(data){
                $('.weui-loadmore').hide();
               if($.trim(data)==''){
                    html = '<div class="weui-cell__hd wx_cells_01" style="width:100%;text-align:center;margin-top:0.1rem;"><img style="margin:0 auto;width:0.77rem;" src="/template/wallet/new/static/assets/images/none2.png"><label class="weui-label" style="margin:0.1rem auto;width:1.5rem;">无更多数据了哦</label></div>';
                    $('#tab2').append(html);
                }else{
                    ajax_status = false;
                    $('#tab2').append(data);
                }
            },
            error:function(){
                $.toptip('网络异常，请稍后再试', 'error');
            }
        })
    } 

    function init(){
      if (ajax_status) return;
        ajax_status = true;
        $('.weui-loadmore').show();
        loadlist();
    }

    // 加载更多商品
    $('.page-bd').infinite(30).on("infinite", function() {
        if (ajax_status) return;
        ajax_status = true;
        $('.weui-loadmore').show();
        setTimeout(function () {
            p++;
            loadlist();
        }, 1500);   //模拟延迟
    });
</script>
</body>
</html>